<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
</head>
<!--将分页的信息提取出来-->
<div class="row" th:fragment="pagination">
    <!--存储页码信息-->
    <input type="hidden" name="pageNum" value=""/>
    <div class="col-sm-6">
        <div class="dataTables_info" id="DataTables_Table_0_info" role="alert" aria-live="polite" aria-relevant="all">
            当前第<span th:text="${page.pageNum}"></span>页/
            共<span th:text="${page.pages}"></span>页
            共<span th:text="${page.total}"></span>条记录
        </div>
    </div>
    <div class="col-sm-6">
        <div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
            <ul class="pagination">
                <!--上一页-->
                <!--判断是否为第一页,是加上禁用,不是就去掉禁用-->
                <li th:if="${page.isFirstPage}" class="paginate_button previous disabled" aria-controls="DataTables_Table_0" tabindex="0" d="DataTables_Table_0_previous">
                    <a href="javascript:;">上一页</a>
                </li>
                <li th:unless="${page.isFirstPage}" class="paginate_button previous" aria-controls="DataTables_Table_0" tabindex="0" id="DataTables_Table_0_previous">
                    <a th:href="'javascript:document.forms.ec.pageNum.value=' + ${page.prePage}+';document.forms.ec.submit();'">上一页</a>
                </li>
                <!--页码导航-->
                <!--循环页码i,如果显示的是当前的页码,就显示阴影,否则就不显示阴影-->
                <li th:class="${page.pageNum==i?'paginate_button active':'paginate_button'}" aria-controls="DataTables_Table_0" tabindex="0" th:each=" i : ${ page.navigatepageNums}">
                    <a th:href="'javascript:document.forms.ec.pageNum.value='+ ${i}+';document.forms.ec.submit();'"><span th:text="${i}"></span></a></li>
                <!--下一页-->
                <li th:if="${page.isLastPage}" class="paginate_button next disabled" aria-controls="DataTables_Table_0" tabindex="0"
                    id="DataTables_Table_0_next">
                    <a href="javascript:;">下一页</a>
                </li>
                <li th:unless="${page.isLastPage}" class="paginate_button next" aria-controls="DataTables_Table_0" tabindex="0" id="DataTables_Table_0_next">
                    <a th:href="'javascript:document.forms.ec.pageNum.value=' + ${page.NextPage}+';document.forms.ec.submit();'">下一页</a>
                </li>
            </ul>
        </div>
    </div>
</div>
<body>
</body>
</html>